      IWCGJQAutoComplete.JQAutoCompleteOptions.MinLength:= 2;
      IWCGJQAutoComplete.JQAutoCompleteOptions.Delay:= 300;
      SL:= TStringList.Create;
      try
        with SL do
        begin
          Add('function( request, response ) {');
          Add('$.ajax({');
          Add(' url: "http://ws.geonames.org/searchJSON",');
          Add(' dataType: "jsonp",');
          Add(' data: {');
          Add('   featureClass: "P",');
          Add('   style: "full",');
          Add('   maxRows: 12,');
          Add('   name_startsWith: request.term');
          Add(' },');
          Add('success: function( data ) {');
          Add(' response( $.map( data.geonames, function( item ) {');
          Add('   return {');
          Add('     label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,');
          Add('     value: item.name');
          Add('   }');
          Add(' }));');
          Add('}');
          Add('});');
          Add('}');
        end;

        IWCGJQAutoComplete.JQAutoCompleteOptions.OnSource.Script:= SL.Text; // JavaScript function
        IWCGJQAutoComplete.JQAutoCompleteOptions.OnSelect.Script:= 'function(event,ui) {'+sLineBreak+
          ' function log( message ) { $( "<div/>" ).text( message ).prependTo("#'+IWCGJQTagObject.HTMLName+'");$("#'+IWCGJQTagObject.HTMLName+'").scrollTop(0);};'+sLineBreak+sLineBreak+
          ' log(ui.item ? "Selected: " + ui.item.label : "Nothing selected, input was " + this.value);}';
        IWCGJQAutoComplete.JQAutoCompleteOptions.OnOpen.Script:= 'function(){$(this).removeClass("ui-corner-all").addClass("ui-corner-top");}';
        IWCGJQAutoComplete.JQAutoCompleteOptions.OnClose.Script:='function(){$(this).removeClass("ui-corner-top").addClass("ui-corner-all");}';
      finally
        SL.Free;
      end;

